﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace psafth.RCTiming.Main.Common
{
    public class SignalStrengthToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double signalStrenght = (double)value;

            if (signalStrenght < 50)
                return Brushes.Red.ToString();

            if (signalStrenght < 60)
                return Brushes.Orange.ToString();

            return Brushes.GreenYellow.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
